package objectOutputStream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectInputStreamDemo1 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //将序列化的文件进行反序列化
        //1.创建反序列化对象
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("IODemo\\user.txt"));
        //2.读取数据
        Object o = ois.readObject();
        //3.打印结果
        System.out.println(o);
        //4.释放资源
        ois.close();

    }
}
